<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript库</title>
    <script src="http://lib.baomitu.com/jquery/latest/jquery.js"></script>
    <link rel="stylesheet" href="../style/common.css">
</head>
<body>
    <h1>JQuery库</h1>
    <p class="msg"></p>
    <p><button>通过jQuery的ajax的处理请求</button></p>
    <script>
        $(document).ready(function(){
            $("button").click(function(){
                $.ajax({
                    url:"http://jsonplaceholder.typeicode.com/posts/1",
                    type:"get",
                    dataType:"json",
                    success:function(result){
                        $(".msg").html(result.title);
                    }
                });
            });
        });
    </script>
</body>
</html>